---
page_title: "cloudflare_user_agent_blocking_rule Resource - Cloudflare"
subcategory: ""
description: |-
  Provides a resource to manage User Agent Blocking Rules.
---

# cloudflare_user_agent_blocking_rule (Resource)

Provides a resource to manage User Agent Blocking Rules.

## Example Usage

```terraform
resource "cloudflare_user_agent_blocking_rule" "example_1" {
  zone_id     = "0da42c8d2132a9ddaf714f9e7c920711"
  mode        = "js_challenge"
  paused      = false
  description = "My description 1"
  configuration {
    target = "ua"
    value  = "Chrome"
  }
}

resource "cloudflare_user_agent_blocking_rule" "example_2" {
  zone_id     = "0da42c8d2132a9ddaf714f9e7c920711"
  mode        = "challenge"
  paused      = true
  description = "My description 22"
  configuration {
    target = "ua"
    value  = "Mozilla"
  }
}
```
<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `configuration` (Block List, Min: 1, Max: 1) The configuration object for the current rule. (see [below for nested schema](#nestedblock--configuration))
- `description` (String) An informative summary of the rule.
- `mode` (String) The action to apply to a matched request. Available values: `block`, `challenge`, `js_challenge`, `managed_challenge`.
- `paused` (Boolean) When true, indicates that the rule is currently paused.
- `zone_id` (String) The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--configuration"></a>
### Nested Schema for `configuration`

Required:

- `target` (String) The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.
- `value` (String) The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.

## Import

Import is supported using the following syntax:

```shell
$ terraform import cloudflare_user_agent_blocking_rule.example <zone_id>/<user_agent_blocking_rule_id>
```
